using System.Text.RegularExpressions;
using Templates.Logic.Base;

namespace Templates.Logic
{
	public class Region : Block
	{
		#region Overrides of Block

		private readonly Regex _beginBlockMatch = new Regex(@"(#region[\s]+(.)+)", RegexOptions.Compiled);
		protected override Regex BeginBlockMatch { get { return _beginBlockMatch; } }

		private readonly Regex _endBlockMatch = new Regex(@"(#endregion[\s\n]?)", RegexOptions.Compiled);
		protected override Regex EndBlockMatch { get { return _endBlockMatch; } }

		private readonly Regex _endLineMatch = new Regex(@"\r\n", RegexOptions.Compiled);
		protected override Regex EndLineMatch { get { return _endLineMatch; } }

		private const string _beginBlockPatternToEndText = @"([\t]*#region[\s]+{0}(.)*)";
		protected override string BeginBlockPatternToEndText { get { return _beginBlockPatternToEndText; } }

		#endregion
	}
}